﻿package plugin.activity
{
    import com.sh.game.consts.*;
    import com.sh.game.global.*;
    import manager.*;
    import view.*;

    public class Activity extends FlashUIBase
    {
        private var _ui:NewActivityUICtrl;

        public function Activity()
        {
            return;
        }// end function

        override protected function preLoaderInit() : void
        {
            super.preLoaderInit();
            appendLoader(Config.getUrl("assets/images/mornui/common.swf", ResourceType.NORMAL));
            appendLoader(Config.getUrl("assets/images/mornui/activity.swf", ResourceType.NORMAL));
            return;
        }// end function

        override protected function initGUI() : void
        {
            this._ui = new NewActivityUICtrl(close);
            mGUI = this._ui;
            return;
        }// end function

        override protected function openRefresh() : void
        {
            if (int(data) == 0)
            {
                if (!PluginManager.instance.checkOpenLevel("activity", 1))
                {
                    this._ui.showView(1);
                }
                else
                {
                    this._ui.showView(2);
                }
            }
            else
            {
                this._ui.showView(int(data));
            }
            return;
        }// end function

        override protected function closeComplete() : void
        {
            super.closeComplete();
            this._ui.closeHandler();
            return;
        }// end function

    }
}
